﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL;

namespace BLL
{
    public class MatHangController
    {
        tbMatHang obj = new tbMatHang();
        public DataTable bllHTMatHang()
        {

            return obj.dalHTDSMatHang();
        }
        public DataTable bllTHDSMatHang(string malh)
        {
            obj.Malh = malh;
            return obj.dalTHDSMatHang();
        }
        public DataTable bllDSMH_MaMH(string mamh)
        {
            obj.Mamh = mamh;
            return obj.dalDSMH_MaMH();
        }
        public bool bllThemMH(string tenmh, string hinh, long giaban, string nhasx, string mota, string malh)
        {
            bool res;
            obj.Tenmh = tenmh;
            obj.Hinh = hinh;
            obj.Giaban = giaban;
            obj.Nhasx = nhasx;
            obj.Mota = mota;
            obj.Malh = malh;
            res = obj.dalThemMH();
            return res;
        }
        public bool bllSuaMH(string tenmh, string hinh, long giaban, string nhasx, string mota, string mamh)
        {
            bool res;
            obj.Tenmh = tenmh;
            obj.Hinh = hinh;
            obj.Giaban = giaban;
            obj.Nhasx = nhasx;
            obj.Mota = mota;
            obj.Mamh = mamh;
            res = obj.dalSuaMH();
            return res;
        }
        public bool bllXoaMH(string mamh)
        {
            bool res;
            obj.Mamh = mamh;
            res = obj.dalXoaMH();
            return res;
        }
    }
}
